<template>
<<<<<<< HEAD
    <div class="addContract">
        <div style="margin-botton:50px">
            <van-cell-group style="text-align:left">
                <van-field
                    label-class='fw'
                    name="质检项目"
                    v-model="form.fcheckitemname"
                    label="质检项目:"
                    @click="showFdeptClick"
                    v-validate="'required'"
                    data-vv-scope="registerForm"
                    :error="errors.has('registerForm.质检项目')"
                    :error-message="errors.first('registerForm.质检项目')"
                    required
                    readonly
                    is-link
                    placeholder="请选择质检项目">
                </van-field>
                <van-popup 
                    v-model="showFdept" 
                    get-container="body" 
                    position='bottom'
                >
                    <van-picker 
                        title='请选择检验类别' 
                        :columns="columns"
                        show-toolbar
                        value-key='fname'
                        @cancel="onCancel4fdeptname"
                        @confirm="onConfirm4fdeptname"
                     />
                </van-popup>
                <van-field
                    label-class='fw'
                    name="检测阶段"
                    v-model="form.fcheckstagename"
                    label="检测阶段:"
                    @click="showStepClick"
                    v-validate="'required'"
                    data-vv-scope="registerForm"
                    :error="errors.has('registerForm.检测阶段')"
                    :error-message="errors.first('registerForm.检测阶段')"
                    required
                    readonly
                    is-link
                    placeholder="请选择检测阶段">
                </van-field>
                <van-popup 
                    v-model="showStep" 
                    get-container="body" 
                    position='bottom'
                >
                    <van-picker 
                        title='请选择检测阶段' 
                        :columns="columns4Step"
                        show-toolbar
                        value-key='text'
                        @cancel="onCancel4Step"
                        @confirm="onConfirm4Step"
                     />
                </van-popup>
                <van-cell title="是否以幂计" class='fw'/>
                <van-radio-group v-model="form.fispower" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>
                <van-field
                    label-class='fw'
                    name="检验方法"
                    v-model="form.fmethodname"
                    label="检验方法:"
                    @click="showMethodClick"
                    readonly
                    is-link
                    placeholder="请选择检验方法">
                </van-field>
                <van-popup 
                    v-model="showMethod" 
                    get-container="body" 
                    position='bottom'
                >
                    <van-picker 
                        title='请选择检验方法' 
                        :columns="columns"
                        show-toolbar
                        value-key='fname'
                        @cancel="onCancel4Method"
                        @confirm="onConfirm4Method"
                     />
                </van-popup>
                <van-cell title="顺序" label-class='fw'>
                    <template #right-icon>
                       <van-stepper v-model="form.forder" />
                    </template>
                </van-cell>


                <van-cell title="是否录入不合格量" class='fw'/>
                <van-radio-group v-model="form.fiswritenumber" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>

                <van-cell title="是否必检" class='fw'/>
                <van-radio-group v-model="form.fismust" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>

                <van-cell title="启用禁用" class='fw'/>
                <van-radio-group v-model="form.fstate" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>启用</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>禁用</van-radio>
                </van-radio-group>

                <van-cell title="是否客户预警" class='fw'/>
                <van-radio-group v-model="form.fisentsys" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>
            </van-cell-group>

            <van-cell-group style="text-align:left;margin-bottom:50px" title="计量单位一">
                 <van-field
                    label-class='fw'
                    name="单位一"
                    v-model="form.funitname1"
                    label="单位一:"
                    @click="showFunitname1Click"
                    v-validate="'required'"
                    data-vv-scope="registerForm"
                    :error="errors.has('registerForm.单位一')"
                    :error-message="errors.first('registerForm.单位一')"
                    required
                    readonly
                    is-link
                    placeholder="请选择单位一">
                </van-field>
                <van-popup 
                    v-model="showFunitname1" 
                    get-container="body" 
                    position='bottom'
                >
                    <van-picker 
                        title='请选择单位一' 
                        :columns="columns"
                        show-toolbar
                        value-key='fname'
                        @cancel="onCancel4Funitname1"
                        @confirm="onConfirm4Funitname1"
                     />
                </van-popup>
                <van-cell title="是否使用默认值" class='fw'/>
                <van-radio-group v-model="form.fisdefault1" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>
                <van-cell title="录入类型" class='fw'/>
                <van-radio-group v-model="form.finputtype1" @change='finputtype1Change'  style="width:90%;margin:0 auto">
                    <van-radio :name="2" style='margin-top:10px'>字符</van-radio>
                    <van-radio :name="1" style='margin-top:10px;margin-bottom:10px'>数值</van-radio>
                </van-radio-group>
                
               <van-field
                    label-class='fw'
                    name="录入方式"
                    v-model="form.finputmode1name"
                    label="录入方式:"
                    @click="showInputModeClick"
                    readonly
                    is-link
                    placeholder="请选择录入方式">
                </van-field>
                <van-popup 
                    v-model="showInputMode" 
                    get-container="body" 
                    position='bottom'
                >
                    <van-picker 
                        title='请选择录入方式' 
                        :columns="columns4Type"
                        show-toolbar
                        value-key='text'
                        @cancel="onCancel4InputMode"
                        @confirm="onConfirm4InputMode"
                     />
                </van-popup>

                <van-field v-model="form.fdefaultvalue1" label="默认值:"  placeholder="请输入默认值" />
                <van-field v-if="form.finputtype1 == 2" v-model="form.fexpressionstring1" label="判断合格值"  />
                <van-cell  v-if="form.finputtype1 == 1" title="是否启用ncmm判定" class='fw'/>
                <van-radio-group v-model="form.fisncmm1" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>
      
                <van-field v-model="form.fmin1" label="ncmm 小m值:"  v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"/>
                <van-field v-model="form.fnvalue1" label="ncmm n值:"  v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"/>
                <van-field v-model="form.fmax1" label="ncmm 大M值:"  v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"/>
                <van-field v-model="form.fcvalue1" label="ncmm c值:"  v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"/>

 

                <van-field
                    label-class='fw'
                    name="判定表达式名称一"
                    v-if="form.fisncmm1 == 0 && form.finputtype1 == 1"
                    v-model="form.fexpressionname1"
                    label="判定表达式名称一:"
                    label-width="130px"
                    readonly
                    is-link
                    >
                </van-field>
                <van-field
                    v-if="form.finputmode1 == '3'"
                    label-class='fw'
                    name="取值公式表达式名称一"
                    v-model="form.fformulaname1"
                    label="取值公式表达式名称一:"
                    readonly
                    label-width="150px"
                    is-link
                    >
                </van-field>

            </van-cell-group>


            <van-cell-group style="text-align:left;margin-bottom:50px" title="计量单位二">
                 <van-field
                    label-class='fw'
                    name="单位二"
                    v-model="form.funitname2"
                    label="单位二："
                    @click="showFunitname2Click"
                    v-validate="'required'"
                    data-vv-scope="registerForm"
                    :error="errors.has('registerForm.单位二')"
                    :error-message="errors.first('registerForm.单位二')"
                    required
                    readonly
                    is-link
                    placeholder="请选择单位二">
                </van-field>
                <van-popup 
                    v-model="showFunitname2" 
                    get-container="body" 
                    position='bottom'
                >
                    <van-picker 
                        title='请选择单位二' 
                        :columns="columns"
                        show-toolbar
                        value-key='fname'
                        @cancel="onCancel4Funitname2"
                        @confirm="onConfirm4Funitname2"
                     />
                </van-popup>
                <van-cell title="是否使用默认值" class='fw'/>
                <van-radio-group v-model="form.fisdefault2" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>
                <van-cell title="录入类型" class='fw'/>
                <van-radio-group v-model="form.finputtype2" @change='finputtype1Change'  style="width:90%;margin:0 auto">
                    <van-radio :name="2" style='margin-top:10px'>字符</van-radio>
                    <van-radio :name="1" style='margin-top:10px;margin-bottom:10px'>数值</van-radio>
                </van-radio-group>
                
               <van-field
                    label-class='fw'
                    name="录入方式"
                    v-model="form.finputmode2name"
                    label="录入方式:"
                    @click="showInputModeClick"
                    readonly
                    is-link
                    placeholder="请选择录入方式">
                </van-field>
                <van-popup 
                    v-model="showInputMode" 
                    get-container="body" 
                    position='bottom'
                >
                    <van-picker 
                        title='请选择录入方式' 
                        :columns="columns4Type"
                        show-toolbar
                        value-key='text'
                        @cancel="onCancel4InputMode"
                        @confirm="onConfirm4InputMode"
                     />
                </van-popup>

                <van-field v-model="form.fdefaultvalue2" label="默认值:"  placeholder="请输入默认值" />
                <van-field v-if="form.finputtype2 == 2" v-model="form.fexpressionstring2" label="判断合格值"  />
                <van-cell  v-if="form.finputtype2 == 1" title="是否启用ncmm判定" class='fw'/>
                <van-radio-group v-model="form.fisncmm2" style="width:90%;margin:0 auto">
                    <van-radio :name="1" style='margin-top:10px'>是</van-radio>
                    <van-radio :name="0" style='margin-top:10px;margin-bottom:10px'>否</van-radio>
                </van-radio-group>
      
                <van-field v-model="form.fmin2" label="ncmm 小m值:"  v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"/>
                <van-field v-model="form.fnvalue2" label="ncmm n值:"  v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"/>
                <van-field v-model="form.fmax2" label="ncmm 大M值:"  v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"/>
                <van-field v-model="form.fcvalue2" label="ncmm c值:"  v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"/>

 

                <van-field
                    label-class='fw'
                    name="判定表达式名称二"
                    v-if="form.fisncmm2 == 0 && form.finputtype2 == 1"
                    v-model="form.fexpressionname2"
                    label="判定表达式名称二:"
                    readonly
                    label-width="130px"
                    is-link
                    >
                </van-field>
                <van-field
                    v-if="form.finputmode2 == '3'"
                    label-class='fw'
                    name="取值公式表达式名称二"
                    label-width="150px"
                    v-model="form.fformulaname2"
                    label="取值公式表达式名称二:"
                    readonly
                    is-link
                    >
                </van-field>

            </van-cell-group>
        </div>
        <div class='faddContractFooter' >
            <div class='rightBtn' @click="save">保存</div>
        </div>
    </div>
=======
  <div class="addContract">
    <div style="margin-botton:50px">
      <van-cell-group style="text-align:left">
        <van-field
          label-class="fw"
          name="质检项目"
          v-model="form.fcheckitemname"
          label="质检项目:"
          @click="showFdeptClick"
          v-validate="'required'"
          data-vv-scope="registerForm"
          :error="errors.has('registerForm.质检项目')"
          :error-message="errors.first('registerForm.质检项目')"
          required
          readonly
          is-link
          placeholder="请选择质检项目"
        ></van-field>
        <van-popup v-model="showFdept" get-container="body" position="bottom">
          <van-picker
            title="请选择质检项目"
            :columns="columns"
            show-toolbar
            value-key="fname"
            @cancel="onCancel4fdeptname"
            @confirm="onConfirm4fdeptname"
          />
        </van-popup>
        <van-field
          label-class="fw"
          name="检测阶段"
          v-model="form.fcheckstagename"
          label="检测阶段:"
          @click="showStepClick"
          v-validate="'required'"
          data-vv-scope="registerForm"
          :error="errors.has('registerForm.检测阶段')"
          :error-message="errors.first('registerForm.检测阶段')"
          required
          readonly
          is-link
          placeholder="请选择检测阶段"
        ></van-field>
        <van-popup v-model="showStep" get-container="body" position="bottom">
          <van-picker
            title="请选择检测阶段"
            :columns="columns4Step"
            show-toolbar
            value-key="text"
            @cancel="onCancel4Step"
            @confirm="onConfirm4Step"
          />
        </van-popup>
        <van-cell title="是否以幂计" class="fw" />
        <van-radio-group v-model="form.fispower" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>
        <van-field
          label-class="fw"
          name="检验方法"
          v-model="form.fmethodname"
          label="检验方法:"
          @click="showMethodClick"
          readonly
          is-link
          placeholder="请选择检验方法"
        ></van-field>
        <van-popup v-model="showMethod" get-container="body" position="bottom">
          <van-picker
            title="请选择检验方法"
            :columns="columns"
            show-toolbar
            value-key="fname"
            @cancel="onCancel4Method"
            @confirm="onConfirm4Method"
          />
        </van-popup>
        <van-cell title="顺序" label-class="fw">
          <template #right-icon>
            <van-stepper v-model="form.forder" />
          </template>
        </van-cell>

        <van-cell title="是否录入不合格量" class="fw" />
        <van-radio-group v-model="form.fiswritenumber" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>

        <van-cell title="是否必检" class="fw" />
        <van-radio-group v-model="form.fismust" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>

        <van-cell title="启用禁用" class="fw" />
        <van-radio-group v-model="form.fstate" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">启用</van-radio>
          <van-radio :name="0" class="halfFlex">禁用</van-radio>
        </van-radio-group>

        <van-cell title="是否客户预警" class="fw" />
        <van-radio-group v-model="form.fisentsys" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>
      </van-cell-group>

      <van-cell-group style="text-align:left;margin-bottom:50px" title="计量单位一">
        <van-field
          label-class="fw"
          name="单位一"
          v-model="form.funitname1"
          label="单位一:"
          @click="showFunitname1Click"
          v-validate="'required'"
          data-vv-scope="registerForm"
          :error="errors.has('registerForm.单位一')"
          :error-message="errors.first('registerForm.单位一')"
          required
          readonly
          is-link
          placeholder="请选择单位一"
        ></van-field>
        <van-popup v-model="showFunitname1" get-container="body" position="bottom">
          <van-picker
            title="请选择单位一"
            :columns="columns"
            show-toolbar
            value-key="fname"
            @cancel="onCancel4Funitname1"
            @confirm="onConfirm4Funitname1"
          />
        </van-popup>
        <van-cell title="是否使用默认值" class="fw" />
        <van-radio-group v-model="form.fisdefault1" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>
        <van-cell title="录入类型" class="fw" />
        <van-radio-group
          v-model="form.finputtype1"
          @change="finputtype1Change"
          class="radioGroupFlex"
        >
          <van-radio :name="2" class="halfFlex">字符</van-radio>
          <van-radio :name="1" class="halfFlex">数值</van-radio>
        </van-radio-group>

        <van-field
          label-class="fw"
          name="录入方式"
          v-model="form.finputmode1name"
          label="录入方式:"
          @click="showInputModeClick('1')"
          readonly
          is-link
          placeholder="请选择录入方式"
        ></van-field>
        <van-popup v-model="showInputMode" get-container="body" position="bottom">
          <van-picker
            title="请选择录入方式"
            :columns="columns4Type"
            show-toolbar
            value-key="text"
            @cancel="onCancel4InputMode"
            @confirm="onConfirm4InputMode"
          />
        </van-popup>

        <van-field v-model="form.fdefaultvalue1" label="默认值:" placeholder="请输入默认值" />
        <van-field v-if="form.finputtype1 == 2" v-model="form.fexpressionstring1" label="判断合格值" />
        <van-cell v-if="form.finputtype1 == 1" title="是否启用ncmm判定" class="fw" />
        <van-radio-group v-model="form.fisncmm1" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>

        <van-field
          v-model="form.fmin1"
          label="ncmm 小m值:"
          v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"
        />
        <van-field
          v-model="form.fnvalue1"
          label="ncmm n值:"
          v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"
        />
        <van-field
          v-model="form.fmax1"
          label="ncmm 大M值:"
          v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"
        />
        <van-field
          v-model="form.fcvalue1"
          label="ncmm c值:"
          v-if="form.fisncmm1 == 1&&form.finputtype1=='1'"
        />

        <van-field
          label-class="fw"
          name="判定表达式名称一"
          v-if="form.fisncmm1 == 0 && form.finputtype1 == 1"
          @click="showfexpression"
          v-model="form.fexpressionname1"
          label="判定表达式名称一:"
          label-width="130px"
          readonly
          is-link
        ></van-field>
        <van-field
          v-if="form.finputmode1 == '3'"
          label-class="fw"
          @click="showfformulaname1Click"
          name="取值公式表达式名称一"
          v-model="form.fformulaname1"
          label="取值公式表达式名称一:"
          readonly
          label-width="150px"
          is-link
        ></van-field>
      </van-cell-group>

      <van-cell-group style="text-align:left;margin-bottom:50px" title="计量单位二">
        <van-field
          label-class="fw"
          name="单位二"
          v-model="form.funitname2"
          label="单位二："
          @click="showFunitname2Click"
          v-validate="'required'"
          data-vv-scope="registerForm"
          :error="errors.has('registerForm.单位二')"
          :error-message="errors.first('registerForm.单位二')"
          required
          readonly
          is-link
          placeholder="请选择单位二"
        ></van-field>
        <van-popup v-model="showFunitname2" get-container="body" position="bottom">
          <van-picker
            title="请选择单位二"
            :columns="columns"
            show-toolbar
            value-key="fname"
            @cancel="onCancel4Funitname2"
            @confirm="onConfirm4Funitname2"
          />
        </van-popup>
        <van-cell title="是否使用默认值" class="fw" />
        <van-radio-group v-model="form.fisdefault2" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>
        <van-cell title="录入类型" class="fw" />
        <van-radio-group
          v-model="form.finputtype2"
          @change="finputtype1Change"
          class="radioGroupFlex"
        >
          <van-radio :name="2" class="halfFlex">字符</van-radio>
          <van-radio :name="1" class="halfFlex">数值</van-radio>
        </van-radio-group>

        <van-field
          label-class="fw"
          name="录入方式"
          v-model="form.finputmode2name"
          label="录入方式:"
          @click="showInputModeClick('2')"
          readonly
          is-link
          placeholder="请选择录入方式"
        ></van-field>
        <van-popup v-model="showInputMode" get-container="body" position="bottom">
          <van-picker
            title="请选择录入方式"
            :columns="columns4Type"
            show-toolbar
            value-key="text"
            @cancel="onCancel4InputMode"
            @confirm="onConfirm4InputMode"
          />
        </van-popup>

        <van-field v-model="form.fdefaultvalue2" label="默认值:" placeholder="请输入默认值" />
        <van-field v-if="form.finputtype2 == 2" v-model="form.fexpressionstring2" label="判断合格值" />
        <van-cell v-if="form.finputtype2 == 1" title="是否启用ncmm判定" class="fw" />
        <van-radio-group v-model="form.fisncmm2" class="radioGroupFlex">
          <van-radio :name="1" class="halfFlex">是</van-radio>
          <van-radio :name="0" class="halfFlex">否</van-radio>
        </van-radio-group>

        <van-field
          v-model="form.fmin2"
          label="ncmm 小m值:"
          v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"
        />
        <van-field
          v-model="form.fnvalue2"
          label="ncmm n值:"
          v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"
        />
        <van-field
          v-model="form.fmax2"
          label="ncmm 大M值:"
          v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"
        />
        <van-field
          v-model="form.fcvalue2"
          label="ncmm c值:"
          v-if="form.fisncmm2 == 1&&form.finputtype2=='1'"
        />

        <van-field
          label-class="fw"
          name="判定表达式名称二"
          v-if="form.fisncmm2 == 0 && form.finputtype2 == 1"
          v-model="form.fexpressionname2"
          label="判定表达式名称二:"
          readonly
          label-width="130px"
          is-link
        ></van-field>
        <van-field
          v-if="form.finputmode2 == '3'"
          label-class="fw"
             @click="showfformulaname2Click"
          name="取值公式表达式名称二"
          label-width="150px"
          v-model="form.fformulaname2"
          label="取值公式表达式名称二:"
          readonly
          is-link
        ></van-field>
      </van-cell-group>
    </div>
    <div class="faddContractFooter">
      <div class="rightBtn" @click="save">保存</div>
    </div>
    <calculator
      ref="calculator"
      :propsfid1="propsfid1"
      :propsfid2="propsfid2"
      :fcheckitemid="form.fcheckitemid"
      @handleClose="handleClose"
      @handleClose_1="handleClose_1"
    ></calculator>
    <van-popup
        v-model="showFullScreen"
        position="bottom"
        :style="{ height: '100%' }"
    >
        <div class='inputFlex'>
            <van-field  v-model="formExpression.input1" type="number" />
            <van-dropdown-menu style="height:40px">
                <van-dropdown-item v-model="formExpression.input4" :options="optionInput4" />
            </van-dropdown-menu>
            <van-field v-model="formExpression.input2" readonly />
            <van-dropdown-menu style="height:40px"> 
                <van-dropdown-item v-model="formExpression.input5" :options="optionInput5" />
            </van-dropdown-menu>
            <van-field v-model="formExpression.input3" type="number" />
        </div>
        <van-field  v-model="formExpression.input7" label="公式" readonly />
        <van-field  v-model="formExpression.input9" label="公式描述" readonly />
        <div class='popupFooter'>
            <div >生成</div>
            <div>确定</div>
        </div>
    </van-popup>
  </div>
>>>>>>> zcm
</template>

<script>
import {
<<<<<<< HEAD
    searchfcode
    ,insertsamplereport
    ,searchbyid
    ,searchchecktype
    ,updatesamplereport
} from '@/api/addSecStandard'
import { 
    Field
    ,DatetimePicker
    , Popup
    ,Cell
    ,CellGroup
    ,Picker
    ,Toast
    ,RadioGroup
    , Radio 
    ,Stepper
} from 'vant';
export default {
    name: 'addContract',
    components: {
        [Stepper.name]:Stepper,
        [Radio.name]:Radio,
        [RadioGroup.name]:RadioGroup,
        [Cell.name]:Cell,
        [CellGroup.name]:CellGroup,
        [Field.name]:Field,
        [DatetimePicker.name]:DatetimePicker,
        [Popup.name]:Popup,
        [Picker.name]:Picker,
    },
    created(){
        this.state = this.$route.query.state
        if(this.state == 'add'){
            
        }else if(this.state == 'edit'){
       
        }else if(this.state == 'view'){
    
        }
    },
    data () {
        return {
            showFunitname2:false,
            showInputMode:false,
            showFunitname1:false,
            showMethod:false,
            showStep:false,
            state:'',
            text:'',
            minDate: new Date(2020, 0, 1),
            maxDate: new Date(2025, 10, 1),
            currentDate: new Date(),
            showTime:false,
            showFdept:false,
            form:{
                fmaxoperato2:'',
                fminoperator2:'',
                fmaxoperator1:'',
                fminoperator1:'',
                fmoduleid: 'base_checkstandarddtlv2',
                fmodulepid: '',
                fmethodname: '',
                fmethodid:'',
                fcheckitemname: '',
                fcheckitemid: '',
                fmethodname: '',
                funitid1: '',
                funitname1: '',
                funitid2: '',
                funitname2: '',
                finputtype1: '',
                finputmode1: '',
                fexpression1: '',
                fformulaid: '',
                fexpression1: '',
                fexpression2: '',
                fformulaid2: '',
                fexpression2: '',
                fischeck: 1,
                fdefaultvalue1: '',
                fiswritenumber: 1,
                fisncmm1: 0,
                fcheckstage: '',
                fordel: '',
                fremark: '',
                fispower: 1,
                fisenergy: 1,
                fformat: '',
                fformulaform2: '',
                fformulaformid2: '',
                fformulaname2: '',
                fformulaform: '',
                fformulaformid: '',
                fformulaname1: '',
                fformulaid1:'',
                fmax1: '',
                fmin1: '',
                fcvalue1: 0,
                fnvalue1: 0,
                fcrpersonid: '',
                fcrperson: '',
                fstate: 1,
                fismust: 1,
                fname: '',
                fdetailid: '',
                fid: '',
                forder: 1,
                fdtlvalues: '',
                fuppersonid: '',
                fupperson: '',
                fisentsys: 0,
                freportnamequalified: '', // 报告合格名称
                freportnameunqualified: '', // 报告不合格名称
                fismustfinshcheck: '', // 产成品入库必检项
                fisdefault1: '', // 是否启用默认值
                fexpressionstring1:'',
                fexpressionstring2:'',
                fdefaultvalue2:'',
                fisncmm2:0,
                finputmode2:'',
                fisdefault2:'',
                finputtype2:'',
                fisqualified2:'',
                fmin2:'',
                fnvalue2:'',
                fmax2:'',
                fcvalue2:'',
                fformulaexpression2:'',
            },
            columns: [
                { text: '客户一',id:'c5f0d33b-ac05-4acd-b8bb-a01226565543'},
                { text: '单位二' },
                { text: '单位三' }
            ],
            columns4Step:[
                { text: '第一阶段',id:'1'},
                { text: '第二阶段',id:'2' },
                { text: '全部' ,id:'12'}
            ],
            columns4Type:[
                { text: '录入',id:'1',disabled:false},
                { text: '读取',id:'2',disabled:false },
                { text: '公式' ,id:'3',disabled:false}
            ]
 
          
        }
    },
    methods:{
        showFunitname2Click(){
            this.showFunitname2 = true
        },  
        onCancel4Funitname2(){
            this.showFunitname2 = false
        },
        onConfirm4Funitname2(){
            this.showFunitname2 = false
        },
        finputtype1Change(val){
            console.log(val)
            this.form.finputmode1name = ''
            this.form.finputmode1 = ''
            this.columns4Type = []
            if(val ==2){
                this.columns4Type[0] = { text: '录入',id:'1',disabled:false}
                this.columns4Type[1] = { text: '读取',id:'2',disabled:true }
                this.columns4Type[2] = { text: '公式' ,id:'3',disabled:true}
            }else if(val ==1){
                this.columns4Type[0] = { text: '录入',id:'1',disabled:false}
                this.columns4Type[1] = { text: '读取',id:'2',disabled:false }
                this.columns4Type[2] ={ text: '公式' ,id:'3',disabled:false}
            }
            console.log(this.columns4Type)
        },  
        showInputModeClick(){
            this.showInputMode = true
        },
        onCancel4InputMode(){
            this.showInputMode = false
        },
        onConfirm4InputMode(val){
            this.form.finputmode1name = val.text
            this.form.finputmode1 = val.id
            this.showInputMode = false
        },
        showFunitname1Click(){
            this.showFunitname1 = true
        },
        onCancel4Funitname1(){
            this.showFunitname1 = false
        },
        onConfirm4Funitname1(val){
            this.showFunitname1 = false
        },
        showMethodClick(){
            this.showMethod = true
        },
        onCancel4Method(){
            this.showMethod = false
        },
        onConfirm4Method(val){
            this.showMethod = false
        },
        showStepClick(){
            this.showStep = true
        },
        onConfirm4Step(val){
            this.form.fcheckstagename = val.text
            this.form.fcheckstage = val.id
            this.showStep = false
        },
        onCancel4Step(){
            this.showStep = false
        },
        formatter(type, val) {
            if (type === 'year') {
                return `${val}年`;
            } else if (type === 'month') {
                return `${val}月`
            } else if (type === 'day') {
                return `${val}日`
            }
            return val;
        },
 
        save(){
            this.$router.push({path:"/addSampleBill2"});
            return
            this.$validator.validateAll('registerForm').then((valid) => {
                console.log(valid)
                if (valid) {
                    if(this.state == 'add'){
                  
                    }else if(this.state == 'edit'){ 
                    
                    }
                }
            })

        },
     
        timeConfirm(val){
            this.form.fcontractdate = this.dateToString(val)
            this.showTime = false
        },
        timecancel(){
            this.showTime = false
        },
        showFdeptClick(){
            this.showFdept = true
        },  
        onCancel4fdeptname(val){
            this.showFdept = false
        },
        onConfirm4fdeptname(val){
            this.form.fchecktypename = val.fname
            this.form.fchecktypeid = val.fid
            this.showFdept = false
        },
        dateToString(date){ 
            var year = date.getFullYear(); 
            var month =(date.getMonth() + 1).toString(); 
            var day = (date.getDate()).toString();  
            if (month.length == 1) { 
                month = "0" + month; 
            } 
            if (day.length == 1) { 
                day = "0" + day; 
            }
            var dateTime = year + "-" + month + "-" + day;
            return dateTime; 
        },
    }
}
=======
  searchfcode,
  insertsamplereport,
  searchbyid,
  searchchecktype,
  updatesamplereport
} from "@/api/addSecStandard";
import calculator from "@/components/calculator";
import {
    Field,
    DatetimePicker,
    Popup,
    Cell,
    CellGroup,
    Picker,
    Toast,
    RadioGroup,
    Radio,
    Stepper,
    Dialog,
    DropdownMenu,
    DropdownItem
} from "vant";
export default {
    name: "addContract",
    components: {
        calculator,
        [DropdownMenu.name]: DropdownMenu,
        [DropdownItem.name]: DropdownItem,
        [Stepper.name]: Stepper,
        [Radio.name]: Radio,
        [RadioGroup.name]: RadioGroup,
        [Cell.name]: Cell,
        [CellGroup.name]: CellGroup,
        [Field.name]: Field,
        [DatetimePicker.name]: DatetimePicker,
        [Popup.name]: Popup,
        [Picker.name]: Picker,
        [Dialog.Component.name]: Dialog.Component
    },
    created() {
        this.state = this.$route.query.type;
        this.propsfid2 = this.$route.query.propsfid2;
        this.propsfid1 = this.$route.query.propsfid1;
        if(this.$route.query.fid){
            this.projectObj.fid = this.$route.query.fid
            this.projectObj.fname = this.$route.query.fname
            this.form.fcheckitemname = this.$route.query.fname
            this.form.fcheckitemid= this.$route.query.fid
        }
        if (this.state == "add") {
        } else if (this.state == "edit") {
        } else if (this.state == "view") {
        }
    },
    data() {
        return {
            disabled4:false,
            optionInput4:[
                { text: '<', value: '<' },
                { text: '<=', value: '<=' },
                { text: '禁用', value: '0' }
            ],
            optionInput5:[
                { text: '<', value: '<' },
                { text: '<=', value: '<=' },
                { text: '禁用', value: '0' }
            ],
            formExpression:{
                input1: '',
                input2: '',
                input3: '',
                input4: '<',
                input5: '<',
                input6: '',
                input7: '',
                input8: '',
                input9: ''
            },
            showFullScreen:false,
            moudleType:'',
            fformulaformType:'',
            projectObj:{},
            propsfid1: "",
            propsfid2: "",
            showFunitname2: false,
            showInputMode: false,
            showFunitname1: false,
            showMethod: false,
            showStep: false,
            state: "",
            text: "",
            minDate: new Date(2020, 0, 1),
            maxDate: new Date(2025, 10, 1),
            currentDate: new Date(),
            showTime: false,
            showFdept: false,
            form: {
                fmaxoperato2: "",
                fminoperator2: "",
                fmaxoperator1: "",
                fminoperator1: "",
                fmoduleid: "base_checkstandarddtlv2",
                fmodulepid: "",
                fmethodname: "",
                fmethodid: "",
                fcheckitemname: "",
                fcheckitemid: "",
                fmethodname: "",
                funitid1: "",
                funitname1: "",
                funitid2: "",
                funitname2: "",
                finputtype1: "",
                finputmode1: "",
                fexpression1: "",
                fformulaid: "",
                fexpression1: "",
                fexpression2: "",
                fformulaid2: "",
                fexpression2: "",
                fischeck: 1,
                fdefaultvalue1: "",
                fiswritenumber: 1,
                fisncmm1: 0,
                fcheckstage: "",
                fordel: "",
                fremark: "",
                fispower: 1,
                fisenergy: 1,
                fformat: "",
                fformulaform2: "",
                fformulaformid2: "",
                fformulaname2: "",
                fformulaform: "",
                fformulaformid: "",
                fformulaname1: "",
                fformulaid1: "",
                fmax1: "",
                fmin1: "",
                fcvalue1: 0,
                fnvalue1: 0,
                fcrpersonid: "",
                fcrperson: "",
                fstate: 1,
                fismust: 1,
                fname: "",
                fdetailid: "",
                fid: "",
                forder: 1,
                fdtlvalues: "",
                fuppersonid: "",
                fupperson: "",
                fisentsys: 0,
                freportnamequalified: "", // 报告合格名称
                freportnameunqualified: "", // 报告不合格名称
                fismustfinshcheck: "", // 产成品入库必检项
                fisdefault1: "", // 是否启用默认值
                fexpressionstring1: "",
                fexpressionstring2: "",
                fdefaultvalue2: "",
                fisncmm2: 0,
                finputmode2: "",
                fisdefault2: "",
                finputtype2: "",
                fisqualified2: "",
                fmin2: "",
                fnvalue2: "",
                fmax2: "",
                fcvalue2: "",
                fformulaexpression2: ""
            },
            columns: [
                { text: "客户一", id: "c5f0d33b-ac05-4acd-b8bb-a01226565543" },
                { text: "单位二" },
                { text: "单位三" }
            ],
            columns4Step: [
                { text: "第一阶段", id: "1" },
                { text: "第二阶段", id: "2" },
                { text: "全部", id: "12" }
            ],
            columns4Type: [
                { text: "录入", id: "1", disabled: false },
                { text: "读取", id: "2", disabled: false },
                { text: "公式", id: "3", disabled: false }
            ]
        };
    },
    methods: {
        showfexpression(){
            
            this.showFullScreen = true
            if(this.state == 'add'){
                this.formExpression.input1 = ''
                this.formExpression.input2 = ''
                this.formExpression.input2 = this.form.fcheckitemname
                this.formExpression.input6 = this.form.fcheckitemid
                this.formExpression.input3 = ''
                this.formExpression.input4 = '<'
                this.formExpression.input5 = '<'
                this.formExpression.input7 = ''
                this.formExpression.input8 = ''
                this.formExpression.input9 = ''
            }else if(this.state == 'edit'){
                this.formExpression.input2 = this.form.fcheckitemname
                this.formExpression.input6 = this.form.fcheckitemid
            }
        },
        // 计算器弹窗关闭
        handleClose() {
            this.result = this.$refs.calculator.result;
            this.$refs.calculator.dialogVisible = false;
        },
        // 计算器弹窗关闭,获取结果
        handleClose_1() {
            if (this.$refs.calculator.result_1.expressioncaption) {
                if (this.fformulaformType == "1") {
                    this.form.fformulaid1 = this.$refs.calculator.result_1.expression;
                    this.form.fformulaname1 = this.$refs.calculator.result_1.expressioncaption;
                } else if (this.fformulaformType == "2") {
                    this.form.fformulaid2 = this.$refs.calculator.result_1.expression;
                    this.form.fformulaname2 = this.$refs.calculator.result_1.expressioncaption;
                }
                this.$refs.calculator.dialogVisibleFormula = false;
            }
        },
        showfformulaname1Click() {
            this.fformulaformType = "1"
            this.$refs.calculator.showcalculator = true;
        },
        showfformulaname2Click() {
            this.fformulaformType = "2"
            this.$refs.calculator.showcalculator = true;
        },
        showFunitname2Click() {
            this.showFunitname2 = true;
        },
        onCancel4Funitname2() {
            this.showFunitname2 = false;
        },
        onConfirm4Funitname2() {
            this.showFunitname2 = false;
        },
        finputtype1Change(val) {
            this.form.finputmode1name = "";
            this.form.finputmode1 = "";
            this.columns4Type = [];
            if (val == 2) {
                this.columns4Type[0] = { text: "录入", id: "1", disabled: false };
                this.columns4Type[1] = { text: "读取", id: "2", disabled: true };
                this.columns4Type[2] = { text: "公式", id: "3", disabled: true };
            } else if (val == 1) {
                this.columns4Type[0] = { text: "录入", id: "1", disabled: false };
                this.columns4Type[1] = { text: "读取", id: "2", disabled: false };
                this.columns4Type[2] = { text: "公式", id: "3", disabled: false };
            }
        },
        showInputModeClick(val) {
            this.moudleType = val
            this.showInputMode = true;
        },
        onCancel4InputMode() {
            this.showInputMode = false;
        },
        onConfirm4InputMode(val) {
            if(this.moudleType == '1'){
                this.form.finputmode1name = val.text;
                this.form.finputmode1 = val.id;
            }else if(this.moudleType == '2'){
                this.form.finputmode2name = val.text;
                this.form.finputmode2 = val.id;
            }
        
            this.showInputMode = false;
        },
        showFunitname1Click() {
            this.showFunitname1 = true;
        },
        onCancel4Funitname1() {
            this.showFunitname1 = false;
        },
        onConfirm4Funitname1(val) {
            this.showFunitname1 = false;
        },
        showMethodClick() {
            this.showMethod = true;
        },
        onCancel4Method() {
            this.showMethod = false;
        },
        onConfirm4Method(val) {
            this.showMethod = false;
        },
        showStepClick() {
            this.showStep = true;
        },
        onConfirm4Step(val) {
            this.form.fcheckstagename = val.text;
            this.form.fcheckstage = val.id;
            this.showStep = false;
        },
        onCancel4Step() {
            this.showStep = false;
        },
        formatter(type, val) {
            if (type === "year") {
                return `${val}年`;
            } else if (type === "month") {
                return `${val}月`;
            } else if (type === "day") {
                return `${val}日`;
            }
            return val;
        },

        save() {
            this.$router.push({ path: "/addSampleBill2" });
            return;
            this.$validator.validateAll("registerForm").then(valid => {
                console.log(valid);
                if (valid) {
                if (this.state == "add") {
                } else if (this.state == "edit") {
                }
                }
            });
        },

        timeConfirm(val) {
            this.form.fcontractdate = this.dateToString(val);
            this.showTime = false;
        },
        timecancel() {
            this.showTime = false;
        },
        showFdeptClick() {
            this.$router.push({ path: "/projectList",query:{type: this.state, propsfid1: this.propsfid1}});
        },
        onCancel4fdeptname(val) {
            this.showFdept = false;
        },
        onConfirm4fdeptname(val) {
            this.form.fchecktypename = val.fname;
            this.form.fchecktypeid = val.fid;
            this.showFdept = false;
        },
        dateToString(date) {
            var year = date.getFullYear();
            var month = (date.getMonth() + 1).toString();
            var day = date.getDate().toString();
            if (month.length == 1) {
                month = "0" + month;
            }
            if (day.length == 1) {
                day = "0" + day;
            }
            var dateTime = year + "-" + month + "-" + day;
            return dateTime;
        }
    }
};
>>>>>>> zcm
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
<<<<<<< HEAD
.faddContractFooter{
    position: fixed;
    left:0;
    bottom:0;
    width:100%;
    height: 40px;
    display: flex;
    flex: 1
}
.leftBtn4addContract{
    line-height: 40px;
    width:100%;
    text-align: center;
    background-color: #07c160;
    color:white;
}
.rightBtn{
    line-height: 40px;
    width:100%;
    text-align: center;
    background-color: #1989fa;
    color:white;  
}

.fw{
    font-weight: 700
}
.lang{
    width:120px
=======
.faddContractFooter {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 40px;
  display: flex;
  flex: 1;
}
.leftBtn4addContract {
  line-height: 40px;
  width: 100%;
  text-align: center;
  background-color: #07c160;
  color: white;
}
.rightBtn {
  line-height: 40px;
  width: 100%;
  text-align: center;
  background-color: #1989fa;
  color: white;
}

.fw {
  font-weight: 700;
}
.lang {
  width: 120px;
}
.halfFlex {
  width: 50%;
  display: flex;
  font-size: 14px;
  justify-content: center;
}
.radioGroupFlex {
  width: 100%;
  display: flex;
  height: 40px;
  line-height: 40px;
}
.inputFlex{
    display:flex
}
.popupFooter{
    width: 100%;
    height: 40px;
    line-height: 40px;
    position: fixed;
    bottom: 0;
    left: 0;
    color: white;
    display: flex;
>>>>>>> zcm
}
</style>
